//
//  TicketNodeCCell.m
//  ImGuider
//
//  Created by 李陆涛 on 2018/6/15.
//  Copyright © 2018年 imguider. All rights reserved.
//

#import "TicketNodeCCell.h"
@interface TicketNodeCCell ()

@property (weak, nonatomic) IBOutlet UIImageView *ticketImageView;
@property (weak, nonatomic) IBOutlet UIView *mengbanView;
@property (weak, nonatomic) IBOutlet UILabel *ticketNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@end

@implementation TicketNodeCCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.mengbanView.backgroundColor = kMengBanColor;
}

- (void)setTicket:(TicketModel *)ticket {
    
    _ticket = ticket;
    
    [self.ticketImageView setImageURL:[NSURL URLWithString:ticket.pictureArray.firstObject] placeholderImage:kPlaceholderRec];
    self.ticketNameLabel.text = ticket.title;
    
    if ([[AppManager sharedManager].currencyCode isEqualToString:@"CNY"]) {
        self.priceLabel.text = [NSString stringWithFormat:@"¥%@",@(ticket.price.integerValue / 100.0f)];
    }else{
        self.priceLabel.text = [NSString stringWithFormat:@"$%@",@(ticket.price.integerValue / 100.0f)] ;
    }
    
}

@end
